/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package skipass;

/**
 *
 * @author andrii
 */
public class NumberOfDaysPass extends DaysOfTheWeekAbstractPass {
    
    private int leftDays;

    NumberOfDaysPass(NumberOfDays numberOfDays, DaysOfTheWeek week) {
        super(week);
        this.leftDays = numberOfDays.getNumberOfDays();
    }
    
    @Override
    public boolean validate() {
        return isValid()
                && isCorrectDayOfTheWeek()
                && isLeftDays();
    }

    private boolean isLeftDays() {
        return leftDays-- > 0;
    }
    
}
